package com.example.demo.thread;

import org.apache.commons.collections.CollectionUtils;

import java.text.NumberFormat;
import java.util.List;
import java.util.concurrent.TimeUnit;

public class Demo {

    public static class MyThread extends Thread
    {
        @Override
        public void run() {
            System.out.println("我是一个继承jdk Thread类生成的线程类");
        }
    }

    public static void main(String[] args) {
        /*Thread thread = new MyThread();
        thread.start();


        // 创建一个数值格式化对象
        NumberFormat numberFormat = NumberFormat.getInstance();
        // 设置精确到小数点后0位
        numberFormat.setMaximumFractionDigits(0);
        String percentage = numberFormat.format((float) 2831 / (float) 3505 * 100);
        System.out.println(percentage);
        int repeatRate = Integer.parseInt(percentage);
        System.out.println(repeatRate);*/

        int loopCounter = 0;
        while (loopCounter < 1000) {
            try {
                if (loopCounter < 100) {
                    continue;
                }
            } catch (Exception e) {
                if (e instanceof InterruptedException) {
                    throw e;
                }
            }
            loopCounter++;
            System.out.println(loopCounter);
        }
        System.out.println(1111111);
    }
}
